<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_sys_class('model', '', 0);
/**
 * 后台课程model
 */
class course_nsr_model extends model {
	public function __construct() {
		$this->db_config = pc_base::load_config('database');
		$this->db_setting = 'default';
		$this->table_name = 'course_nsr';
		parent::__construct();
	}
	
	//根据 agency_id来获取该机构下所有的课程
	public function check_course($agency_id){
	    //$agency_id：机构ID
	    if(is_array($agency_id)){
	        $agency_id =  implode(',', $agency_id);
	        $where = ' status = 1 and  agency_id in ('.$agency_id.')';
	    }else{
	        $where = ' status = 1 and  agency_id ='.$agency_id;
	    }
	    $course_list = $this->select($where,"id");
	    
	    return $course_list;
	}
}